package tk.heimashuma.store.repository;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import tk.heimashuma.store.entity.Transaction;
import tk.heimashuma.store.entity.Users;

public interface TransactionRepository extends JpaRepository<Transaction,Integer> {
    @Query(value = "select * from transaction where t_id = :t_id",nativeQuery = true)
    Transaction findAllByTId(String t_id);

    Page<Transaction> findAllByUser(Users user, PageRequest pageRequest);
}
